import pygame

class VolumeSetBase(pygame.sprite.Sprite):
    def __init__(self,width,height):
        pygame.sprite.Sprite.__init__(self)
        
        self.width,self.height=width,height
        self.image=pygame.image.load('images/volume_set_base.png').convert_alpha()
        self.rect=self.image.get_rect()
        self.rect.left,self.rect.top=width,height
    def arise(self):
        self.rect.left,self.rect.top=300,230
    def move(self,mouse_pos):
        self.rect.left,self.rect.top=mouse_pos[0]-100,mouse_pos[1]-10
    def reset(self):
        self.rect.left,self.rect.top=self.width,self.height
        
class VolumeSetButton(pygame.sprite.Sprite):
    def __init__(self,width,height):
        pygame.sprite.Sprite.__init__(self)
        
        self.width,self.height=width,height
        self.image=pygame.image.load('images/volume_set_button.png').convert_alpha()
        self.rect=self.image.get_rect()
        self.rect.left,self.rect.top=width,height
        self.volume_value=1.2
        self.switch=False

    def arise(self,base_pos,value):
        self.rect.left=value*100+base_pos[0]+10
        self.rect.top=base_pos[1]

    def move(self,base_pos,mouse_pos):
        self.rect.top=base_pos[1]
        self.rect.left=mouse_pos[0]-5
        if self.rect.left<base_pos.left+10:
            self.rect.left=base_pos.left+10
        if self.rect.right>base_pos.right-10:
            self.rect.right=base_pos.right-10
        self.volume_value=(mouse_pos[0]-(base_pos[0]+10))/100

    def reset(self):
        self.rect.left,self.rect.top=self.width,self.height

class PauseButton(pygame.sprite.Sprite):
    def __init__(self,width,height):
        pygame.sprite.Sprite.__init__(self)
        
        self.width,self.height=width,height
        self.image=pygame.image.load('images/pause_button.png').convert_alpha()
        self.word_image=pygame.image.load('images/pause_button_word.png').convert_alpha()
        self.rect=self.image.get_rect()
        self.rect.left,self.rect.top=width-self.rect.width,0

class StartButton(pygame.sprite.Sprite):
    def __init__(self,width,height):
        pygame.sprite.Sprite.__init__(self)
        
        self.width,self.height=width,height
        self.image=pygame.image.load('images/start_button.png').convert_alpha()
        self.word_image=pygame.image.load('images/start_button_word.png').convert_alpha()
        self.rect=self.image.get_rect()
        self.rect.left,self.rect.top=width-self.rect.width,0

class MouseIcon(pygame.sprite.Sprite):
    def __init__(self,width,height):
        pygame.sprite.Sprite.__init__(self)

        self.width,self.height=width,height
        self.image=pygame.image.load('images/mouse_icon1.png').convert_alpha()
        self.image2=pygame.image.load('images/mouse_icon2.png').convert_alpha()
        self.image3=pygame.image.load('images/mouse_icon3.png').convert_alpha()
        self.rect=self.image.get_rect()
        self.rect.left,self.rect.top=width,height

    def move(self,mouse_pos):
        self.rect.left,self.rect.top=mouse_pos[0]-10,mouse_pos[1]-10

class StartOption(pygame.sprite.Sprite):
    def __init__(self,width,height):
        pygame.sprite.Sprite.__init__(self)

        self.width,self.height=width,height
        self.image=pygame.image.load('images/start_option.png').convert_alpha()
        self.word_image=pygame.image.load('images/start_option_word.png').convert_alpha()
        self.rect=self.image.get_rect()
        self.rect.left,self.rect.top=width,height

class VolumeSetOption(pygame.sprite.Sprite):
    def __init__(self,width,height):
        pygame.sprite.Sprite.__init__(self)

        self.width,self.height=width,height
        self.image=pygame.image.load('images/volume_set_option.png').convert_alpha()
        self.word_image=pygame.image.load('images/volume_set_option_word.png').convert_alpha()
        self.rect=self.image.get_rect()
        self.rect.left,self.rect.top=width,height

class EndOption(pygame.sprite.Sprite):
    def __init__(self,width,height):
        pygame.sprite.Sprite.__init__(self)

        self.width,self.height=width,height
        self.image=pygame.image.load('images/end_option.png').convert_alpha()
        self.word_image=pygame.image.load('images/end_option_word.png').convert_alpha()
        self.rect=self.image.get_rect()
        self.rect.left,self.rect.top=width,height
        

        
